package com.rayo.accesscontrollercopy.model.network.bean;

import com.alibaba.fastjson.annotation.JSONField;
import com.rayo.accesscontrollercopy.config.NetworkConfig;

import java.util.Date;

/**
 * Created by yanghaojie on 2017/2/8.
 */

public class BaseApi<T> {
    public final static String CMD = "cmd";
    public final static String SITE = "site";
    public final static String DATA = "data";
    public final static String TIME = "time";

    private int cmd;
    private String site;
    private T data;
    @JSONField(format = NetworkConfig.JSON_DATE_TIME)
    private Date time;

    public BaseApi() {
        this.cmd = 0;
        this.site = "";
        this.data = null;
        this.time = new Date();
    }

    public BaseApi(int cmd, String site, T data) {
        this.cmd = cmd;
        this.site = site;
        this.data = data;
        this.time = new Date();
    }

    public int getCmd() {
        return cmd;
    }

    public void setCmd(int cmd) {
        this.cmd = cmd;
    }

    public String getSite() {
        return site;
    }

    public void setSite(String site) {
        this.site = site;
    }

    public Object getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public Date getTime() {
        return time;
    }

    public void setTime(Date time) {
        this.time = time;
    }
}
